    // onSuccess Callback
    // This method accepts a Position object, which contains the
    // current GPS coordinates
    //
    var onSuccess = function(position) {
        console.log(JSON.stringify(position))        	
           document.getElementById("loc").innerHTML="TIME:"+position.time+"; LOCATION-latitude"+position.latitude+"LOCATION-longitude"+position.longitude;
        
       // 初始化地图,设置中心点坐标和地图级别
       if (position && position.latitude) {
	     map.centerAndZoom(new BMap.Point(position.longitude, position.latitude), 15);             
 	     var bPoint=new BMap.Point(position.longitude, position.latitude);
            var marker = new BMap.Marker(bPoint);
            map.addOverlay(marker);
        }
        else {
	     map.centerAndZoom(new BMap.Point(116.404, 39.925), 15);             
 	     var bPoint=new BMap.Point(116.404, 39.925);
           var marker = new BMap.Marker(bPoint);
           map.addOverlay(marker);
        }
        
      };
  
      // onError Callback receives a PositionError object
      //
      function onError(error) {
        console.log(JSON.stringify(error))
      }
  